<form action="#" method="post">	
<fieldset>
<legend>Config you soj database </legend>

	<label >Dbms type:</label>/*{{{*/
	<input type="text" name="dbms_type" value="mysql"/></br>/*}}}*/
	<label >Dbms host address:</label>/*{{{*//*{{{*/
	<input type="text" name="host" value="Localhost"/></br>/*}}}*/
	<label >Dbms username:</label>/*}}}*/
	<input type="text" name="user" value="test"/></br>/*{{{*/
	<label >Dbms password:</label>/*}}}*/
	<input type="text" name="passwd" value="test"/></br>/*{{{*//*{{{*/
	<label >Db name:</label>/*}}}*/
	<input type="text" name="db_name" value="test_soj"/></br>/*}}}*/

</fieldset>
<fieldset>
<legend>Config you soj path</legend>

	<label >WWWROOT:</label>
	<input type="text" name="root_path" value=""/></br>
	<input type="submit" />

</fieldset>
</form>
<?php
require_once('Config.php');

$request = $_POST ;

$config = new Config();
$conf =& new Config_Container('section', 'root');
$config->setRoot($conf);

@$dbms_type = $request['dbms_type'] ;
@$host = $request['host'] ;
@$user = $request['user'] ;
@$passwd = $request['passwd'] ;
@$db_name = $request['db_name'] ;

@$root_path = $request['root_path'];

$conf_db =& $conf->createSection('database');
$conf_db->createDirective( 'dbms_type' , $dbms_type );
$conf_db->createDirective( 'host' , $host );
$conf_db->createDirective( 'user' , $user );
$conf_db->createDirective( 'passwd' , $passwd );
$conf_db->createDirective( 'db_name' , $db_name );


$conf_path =& $conf->createSection('path');
$conf_path->createDirective( 'root_path' , $root_path );

$config->writeConfig( './soj_config.php' , 'phparray' , array('name' => 'soj') );
?> 
